﻿using CarAppDto.Base;
using FluentValidation;

namespace CarAppDto.CarParts.CarPartsTypeDtos
{
    /// <summary>
    ///数据校验类要继承自 AbstractValidator
    ///通过 AbstractValidator 的泛型参数指定对哪个类进行校验
    /// </summary>
    public class ReqAddCarPartsTypeValidator : AbstractValidator<ReqAddCarPartsType>
    {
        /// <summary>
        /// 校验规则写到校验类的构造方法中
        /// </summary>
        public ReqAddCarPartsTypeValidator()
        {
            RuleFor(x => x.Name).NotEmpty().Length(1, 128);
            RuleFor(x => x.TypeCode).NotEmpty().Length(1, 16);
        }
    }
    public class ReqAddCarPartsType : BaseAddModel
    {

        /// <summary>
        ///  区域中文名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        ///  区域英文名称
        /// </summary>
        public string? EnglishName { get; set; }
        /// <summary>
        /// 分类代码
        /// </summary>
        public string? TypeCode { get; set; }

        /// <summary>
        /// 父级Id
        /// </summary>

        public string? ParentId { get; set; }

    }
}
